args = inputbox("r=?",args,"45")
dim app,doc,v
set app=application
set doc=app.activedocument
set v = doc.ActiveView
main
'msgbox "done"
sub main
	dim rotation
	select case args
		case 0
			rotation=0
		case 1
			rotation=90
		case 2 
			rotation=180
		case 3
			rotation=270
		case else
			rotation= cdbl(args)
	end select
	'msgbox isnumeric(rotation)	
	'rotation = cdbl(rotation)
	if isnumeric(rotation)  then 
	else
		exit sub
	end if
	'msgbox rotation
	dim ischeck
	ischeck = rotation<0	
	'if ischeck then exit sub
	ischeck = rotation>360	
	'if ischeck then exit sub
	
	dim cmps,cmp
	set cmps = doc.getobjects(1,,true)	
	for each cmp in cmps
		'doc.SelectObjects ppcbObjectTypeAll, "*", False 
		'msgbox cmp.name
		doc.Components(cmp.name).Orientation=rotation
	next	
end sub